package com.ticket.sass.admin.dto.input.config;

import com.ticket.sass.admin.validator.InEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.Valid;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.List;

/**
 * @author ywb
 * @date 2024-03-22 17:29
 */
@Data
@ApiModel
public class TicketRefundConfigInput {
    @InEnum(intValues = {1, 2})
    @NotNull(message = "退改类型不能为空")
    @ApiModelProperty(value = "退改类型：1退票，2改签")
    private Short type;
    
    @ApiModelProperty(value = "是否启用")
    private Boolean enable = Boolean.FALSE;
    

    @Min(value = -1)
    @NotNull(message = "每月可退改次数不能为空")
    @ApiModelProperty(value = "每月可退改次数，-1 无限，> -1 指定次数")
    private Integer max;
    
    @NotNull
    @ApiModelProperty(value = "说明")
    private String instructions;
    
    @Valid
    @ApiModelProperty(value = "退改签规则", required = true)
    private List<TicketRefundRuleInput> ticketRefundRules = new ArrayList<>();
}
